<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        const arr = [
            { a: 'name', b: 'zhangsan' },
            { a: 'height', b: '183' },
            { a: 'weight', b: '999' },
        ];

        const result = {
            name: 'zhangsan',
            height: 183,
            weight: 99,
        };

        // arr to obj
        function arr2obj (arr) {
            const obj = {};
            for (const item of arr) {
                const key = item.a;
                const value = item.b;
                obj[key] = value;
            }
            return obj;
        }

        console.log(arr2obj(arr)); // result

    </script>
</body>
</html>